var list = document.querySelector('#bannerlist');
var liHeight = 0;
var itemCount = 3;
function init() {
  for (var i = 0; i < itemCount; i++) {
    var li = document.createElement('li');
    li.className = 'item';
    li.innerText = '我是第' + i + '项';
    list.appendChild(li);
  }

  var firstItem = list.children[0].cloneNode(true);
  list.appendChild(firstItem);

  liHeight = firstItem.offsetHeight;

  startScoll();
}

var curIndex = 0;
var timerId;
function startScoll() {
  clearInterval(timerId);

  curIndex++;
 
  var durtionTime = 1000;
  if (curIndex === itemCount) {
    durtionTime = 100;
  } else {
    durtionTime = 1500;
  }
  timerId = setInterval(() => {
    if (curIndex === itemCount) {
      
    }
  }, durtionTime);
}

init();
